//瓶身做个物体
// urp的lit瓶子做个半透明 ，surface Type to transparent
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

//挂在相机上
public class MyPlaceMgr :MonoBehaviour{

    public float MaxWobble = 0.05f;
    public float WobbleSpeed = 1.0f;
    public float Recovery = 1.0f;


   void Start()
    {
    }

   
    void Update()
    {
       

    }
    public  void OnEnterDie(MyAIBase target)
    {
        print($"{target.gameObject.name} is dead");

        //防止重复进入死亡状态
        if(target.state == AIState.Die)
        {
            return;
        }

        //1.设置死亡状态
        target.GetComponent<MyAIBase>().state = AIState.Die;
        target.GetComponent<MyPlaceableView>().data.hitPoints= 0;
        //2.播放死亡动画
        if(target.GetComponent<Animator>() ! == null)
        {
            target.GetComponent<Animator>().SetTrigger("IsDead");
        }
        //3TODO:死亡溶解
        
      target.GetComponent<SkeletonRenderer>().material. =SetFloat(_dissolveFactor,0);

        //4 死亡东湖哈

    }
}
